<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 500px;
            height: 300px;
            border: 1px solid #000;
        }

        div {
            box-sizing: border-box;
            width: 100px;
            display: flex;
            justify-content: center;
            border: 1px solid #000;
        }

        button {
            margin: 0 10px;
        }
    </style>
</head>

<body>

    <div class="container">
        <div><span></span><input type="button" value="登录"></div>
    </div>

    <script>
        let btn = document.querySelector('div input');
        console.log(btn);

        let spa = document.querySelector('span'); 

        let j = 10;
        spa.innerHTML = j;
        function count() {  
            if (j === 0) { 
                btn.removeAttribute('disabled');
                alert('现在可以点击登录了');
               
                // j=11;
                j = 1
                spa.innerHTML = j; 
                clearTimeout(c)
            } else {
                btn.setAttribute('disabled', 'disabled')
            }
            j--;
            spa.innerHTML = j;
        }
        let c = setInterval(count, 1000)
    </script>
</body>

</html>